<template>
 <a-modal v-model="dialogVisible" title="报警处理" @ok="onSubmit" width="793px"  @cancel="handleClose" centered>

    <a-form-model
      ref="queryParamsRefs"
      :model="params"
      :rules="userRules"
         :labelCol="{span: 2}"
        :wrapperCol="{span: 22}"
      label-position="left"
    >
      <!-- <a-form-model-item :colon="false" label="相关照片" prop="userName">
        <div class="pic_top">
          <img src="../../../assets/img/car.png" style="width:217px;" alt />
          <img src="../../../assets/img/car.png" style="width:217px;" alt />
          <img src="../../../assets/img/car.png" style="width:217px;" alt />
        </div>
      </a-form-model-item> -->
      <a-form-model-item :colon="false" name="radioGroup" label="判定结果" prop="role">
        <a-radio-group v-model="params.disposeStatus">
          <a-radio :value="1">真实</a-radio>
          <a-radio :value="3">误报</a-radio>
          <a-radio :value="2">测试</a-radio>
        </a-radio-group>
      </a-form-model-item>
      <a-form-model-item :colon="false"  class="forms_last" label="处理说明" prop="role">
        <a-input type="textarea" :rows="4" placeholder="请输入内容" v-model="params.disposeDeclare"></a-input>
      </a-form-model-item>
    </a-form-model>
 </a-modal>
</template>
<script>

import { updateEntity } from '@/services/car'

export default {
  data () {
    return {
      dialogVisible: false,
      params: {
        disposeStatus: 1,
        status: 1
      },
      value1: [],
      userRules: {},
      optionsStatus: [],
      radio: 3,
      textarea: ''
    }
  },
  methods: {
    onInitial (id) {
      this.dialogVisible = true
      this.params = {
        id: id,
        disposeStatus: 1,
        status: 1
      }
    },

    // 导入
    async onSubmit () {
      if (this.params.disposeDeclare) {
        const res = await updateEntity(this.params)
        const { isSuccess, msg } = res
        if (isSuccess) {
          this.$emit('getList')
          this.dialogVisible = false

          this.$message.newFun('成功', 'success', 2)
        } else {
          this.$message.newFun(msg, 'error', 2)
        }
      } else {
        this.$message.newFun('请填写完整信息', 'error', 3)
      }
    },
    // 关闭
    handleClose () {
      this.dialogVisible = false
    }
  }
}
</script>
<style lang="less" >
.downBox {
  height: 22px;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  color: #606266;
  line-height: 22px;
}
.downBoxCount {
  height: 20px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  color: #606266;
  line-height: 20px;
  margin-top: 12px;
}
.xu_border {
  width: 360px;
  text-align: center;
  height: 150px;
  background: #ffffff;
  border: 1px dashed #d9d9d9;
  border-radius: 4px;
  img {
    width: 38px;
    height: 40px;
    margin-top: 20px;
  }
  .name {
    height: 17px;
    font-size: 12px;
    font-weight: 400;
    color: #606266;
    line-height: 17px;
    margin: 8px 0 12px;
  }
}

.pic_top {
  display: flex;
  justify-content: space-between;
}
</style>
